const express = require('express');
//创建路由对象
const current = require('./router/current')
const history = require('./router/history')
const add = require('./router/add')
const public = require('./router/public')
const note = require('./router/note')
const mobile = require('./router/mobile')
const password = require('./router/password')
const joinOrCancle = require('./router/joinOrCancle')
const sign = require('./router/sign')
////使用此中间件可以解决跨域问题
const cors = require('cors');
//引入数据库连接
require('./model/index')
//接收post参数的模块
// const bodyParser = require('body-parser')
const app = express();
app.use(cors());
//为路由对象匹配请求路径
app.use(express.urlencoded({ extended: false }))
app.use('/current', current);
app.use('/history', history);
app.use('/add', add);
app.use('/public', public);
app.use('/note', note);
app.use('/mobile', mobile);
app.use('/password', password);
app.use('/joinOrCancle', joinOrCancle);
app.use('/sign', sign);


app.listen(3000)
console.log('网站服务器启动成功！');